package com.dh.blog.auth;

public class AuthUtils {
	private static ThreadLocal<String> identifies = new ThreadLocal<String>();
	/**
	 * 添加身份信息
	 * @param request
	 * @param identitfy
	 */
	public static void addIdentify(String identitfy){
		identifies.set(identitfy);
	}
	/**
	 * 获得身份信息并删除
	 * @return
	 */
	public static String getIdentifyAndRemove(){
		String identify = identifies.get();
		identifies.remove();
		return identify;
	}
	/**
	 * 获得身份信息
	 * @return
	 */
	public static String getIdentify(){
		return identifies.get();
	}
	/**
	 * 删除身份信息
	 */
	public static void removeIndentify(){
		identifies.remove();
	}
}
